/*
 * Main.java
 *  java program model for www.programming-challenges.com
 */

import java.io.*;
import java.util.ArrayList;

public class Main implements Runnable{
	/* utility function to read from stdin,
	   Provided by Programming-challenges, edit for style only */
	static String ReadLn(int maxLength){  
		byte line[] = new byte [maxLength];
		int length = 0;
		int input = -1;
		try{
			/* Read until maxLength or until end of line input */
			while (length < maxLength){
				input = System.in.read();
				if ((input < 0) || (input == '\n')) break; 
				line [length++] += input;
			}

			if ((input < 0) && (length == 0)) return null;  // eof
			return new String(line, 0, length);
		}catch (IOException e){
			return null;
		}
	}
	
	/* utility function to get clean String by mcjung */
	static final private String REGEX_WHITESPACE = "\\s+";	
	static String getCleanLine(String dirtyLine) {
		return dirtyLine.trim().replaceAll(REGEX_WHITESPACE, " ");
	}

	public static void main(String args[])  // entry point from OS
	{
		Main myWork = new Main();  // Construct the bootloader
		myWork.run();            // execute
	}

	public void run() {
		new myStuff().run();
	}
}

class myStuff implements Runnable{
	static final private int readLength = 255;	

	public void run(){
		boolean first = true;
		Trip trip = null;
		
		while(true) {
			String input = Main.ReadLn(readLength);			
			if(input == null) break;			

			String cleanLine = Main.getCleanLine(input);			
			
			if(first) {
				int numberOfStudents = Integer.parseInt(cleanLine); 
				if(numberOfStudents > 0) {
					trip = new Trip(numberOfStudents);
					first = false;
				} else 
					break;
			} else {
				try {
					double money = Double.parseDouble(cleanLine);
					trip.addMoney(money);										
				}catch (Exception e) {					
				}
				if(trip.mNumberOfStudents == trip.getMoneyList().length) {
					int resultInCents = (int)(trip.calculateMeanSpiltMoney() * 100);
					int dollarPart = resultInCents / 100;
					int centPart = resultInCents % 100;
					System.out.println("$" + dollarPart + "."
							+ (centPart < 10 ? "0" + centPart : centPart));					
					first = true;
				}
			}			
		}

	}

	static public class Trip {
		private int mNumberOfStudents;
		private int mLastIndex;
		private double[] mMoneyList;

		public Trip(int numberOfStudents) {
			mNumberOfStudents = numberOfStudents;
			mMoneyList = new double[numberOfStudents];
			mLastIndex = 0;
		}

		public int getNumberOfStudents() {		
			return mNumberOfStudents;
		}

		public void addMoney(double money) throws Exception {
			if(mLastIndex + 1 > mNumberOfStudents) throw new Exception();
			mMoneyList[mLastIndex] = money;
			++mLastIndex;
		}

		public double[] getMoneyList() {		
			return mMoneyList;
		}

		public double getMeanSpiltMoney() throws Exception {		
			return calculateMeanSpiltMoney();
		}

		private double calculateMeanSpiltMoney(){		
			double result_upper = 0;
			double result_lower = 0;
			
			double mean = calculateMean(mMoneyList);		
			
			for(int i = 0; i < mMoneyList.length; ++i) {
				if(mMoneyList[i] > mean)
					result_upper += mMoneyList[i] - mean;
				else
					result_lower += mean - mMoneyList[i];					
			}				
			/*
			double total = calculateTotal(mMoneyList);
			double remain = total - (mean * mMoneyList.size());
			remain = rounding(remain, 2);		
			if(remain != 0.0) {
				result -= (remain / 2);
			}
			*/
			
			if(result_lower > result_upper)
				return result_upper;
			else
				return result_lower;
			
		}

		static public double calculateMean(double[] moneyList) {
			double result = 0;
			
			double total = calculateTotal(moneyList);		
			result = total / moneyList.length;
			
			return ((int)result * 100) / 100;
		}
		
		static public double calculateTotal(double[] moneyList) {
			double total = 0;
			for(int i = 0; i < moneyList.length; ++i) {
				total += moneyList[i];
			}
			
			return rounding(total, 2);
		}
		
		static public double rounding(double number, int lastpoint) {
			long result = Math.round(number * 100.00);				
			return result / 100.00;
		}

	}
	
}

